Position the focus rectangle correctly in RTL mode. (#333291, Benjamin
authorMatthias Clasen <mclasen@redhat.com>
Sat, 4 Mar 2006 05:17:40 +0000 (05:17 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sat, 4 Mar 2006 05:17:40 +0000 (05:17 +0000)
2006-03-04  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkexpander.c (gtk_expander_paint_focus): Position
the focus rectangle correctly in RTL mode.  (#333291,
Benjamin Berg)

ChangeLog
ChangeLog.pre-2-10
gtk/gtkexpander.c

index c5adae625e12cfd3e8597ae9762e5f1d9bf49d31..5a68551c1d2aaf885f873a478fc124ca53c6857d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-04  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkexpander.c (gtk_expander_paint_focus): Position
+       the focus rectangle correctly in RTL mode.  (#333291,
+       Benjamin Berg)
+
 2006-03-03  Tor Lillqvist  <tml@novell.com>
 
        * gtk/gtkimcontextsimple.c (gtk_im_context_simple_commit_char)
index c5adae625e12cfd3e8597ae9762e5f1d9bf49d31..5a68551c1d2aaf885f873a478fc124ca53c6857d 100644 (file)
@@ -1,3 +1,9 @@
+2006-03-04  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkexpander.c (gtk_expander_paint_focus): Position
+       the focus rectangle correctly in RTL mode.  (#333291,
+       Benjamin Berg)
+
 2006-03-03  Tor Lillqvist  <tml@novell.com>
 
        * gtk/gtkimcontextsimple.c (gtk_im_context_simple_commit_char)
index bf537ca7c76952cd9e01951607ed0e73599236ab..a5688806c1e66587b88e214a004c5f85d3c9e3a0 100644 (file)
@@ -817,12 +817,6 @@ gtk_expander_paint_focus (GtkExpander  *expander,
 
   ltr = gtk_widget_get_direction (widget) != GTK_TEXT_DIR_RTL;
   
-  x = widget->allocation.x + border_width;
-  y = widget->allocation.y + border_width;
-
-  if (ltr && interior_focus)
-    x += expander_spacing * 2 + expander_size;
-
   width = height = 0;
 
   if (priv->label_widget && GTK_WIDGET_VISIBLE (priv->label_widget))
@@ -833,15 +827,29 @@ gtk_expander_paint_focus (GtkExpander  *expander,
       height = label_allocation.height;
     }
 
+  width  += 2 * focus_pad + 2 * focus_width;
+  height += 2 * focus_pad + 2 * focus_width;
+
+  x = widget->allocation.x + border_width;
+  y = widget->allocation.y + border_width;
+
+  if (ltr)
+    {
+      if (interior_focus)
+       x += expander_spacing * 2 + expander_size;
+    }
+  else
+    {
+      x += widget->allocation.width - 2 * border_width
+       - expander_spacing * 2 - expander_size - width;
+    }
+
   if (!interior_focus)
     {
       width += expander_size + 2 * expander_spacing;
       height = MAX (height, expander_size + 2 * expander_spacing);
     }
       
-  width  += 2 * focus_pad + 2 * focus_width;
-  height += 2 * focus_pad + 2 * focus_width;
-
   gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
                   area, widget, "expander",
                   x, y, width, height);